package org.xteam.sled.semantic;

import org.xteam.parser.runtime.Span;
import org.xteam.sled.model.BasePattern;
import org.xteam.sled.semantic.exp.Exp;
import org.xteam.sled.semantic.exp.ExpVar;


public class PatternLabel implements IDenotable {

	private String label;

	public PatternLabel(String label) {
		this.label = label;
	}

	@Override
	public Exp projectInt(IEvaluationContext context, Span span) {
		return new ExpVar(label);
	}

	@Override
	public BasePattern projectPattern(IEvaluationContext context, Span span) {
		context.reportError(span, "not an pattern expression");
		return null;
	}
	
	@Override
	public String toString() {
		return label;
	}

}
